import React, {Component} from 'react';
import {
    Flex,
    Icon,
    Tabs,
    NavBar,
    Popover,
    WingBlank,
    WhiteSpace,
    Carousel,
    Modal,
    Grid,
    List,
    Button,
    Toast,
} from 'antd-mobile';
import { connect } from 'dva';
import Moment from 'moment';
import NoLazyImg from '../../components/NoLazyImg/NoLazyImg';
import MyListView from '../../components/MyListView/MyListView';
import {routerRedux} from "dva/router";
import {checkbox} from './findPeople.less';
import NavTopBar from '../../components/NavTopBar/NavTopBar';
import {Checkbox} from "antd-mobile/lib/index";
import {evalute_madel} from "../evaluate/EvaluateListItem.less";
import FindFollowItem from './findFollowItem';
import {gotoLoginAndBack} from "../../utils/common";
import {noguanzhu} from "./findIndex.less";
const Item = Popover.Item;
const CheckboxItem = Checkbox.CheckboxItem;



class FindFollow extends Component {
    constructor(props){
        super(props);
        this.state={
            visible: false,
            num:0
        };
        this.AlloyTouch = null;
    }


    componentDidMount(){
        this.refresh();
    }
    refresh = () => {
        return this.props.dispatch({ type: 'findOthers/getConListEFF',obj:{pageNo:1} });
    }

    loadMore = () => {
        return this.props.dispatch({ type: 'findOthers/getConListEFF', obj:{pageNo:this.props.findOthers.pageNo+1} });
    }

    getAlloyTouch = (AT) =>{
        this.AlloyTouch = AT;
    };

    render() {
        const {dispatch} = this.props;
        const {trendsConnerEntities=[]}=this.props.findOthers;
        console.log(this.props.findOthers)
        return ( <Flex direction="column" style={{height:"100%",background:"#fff"}}>

                <NavTopBar title="我的关注" dispatch={this.props.dispatch}/>
                {trendsConnerEntities==undefined||trendsConnerEntities==""?
                    <div className={noguanzhu}>
                        <div className="guanzhuLogo"></div>
                        <div >您还没有关注好友</div>
                        <div style={{color:"#999",marginTop:".3rem"}}>关注后可实时查看对方的最新动态</div>
                    </div>
                    : <MyListView
                    style={{marginBottom:"1rem"}}
                    getAlloyTouch={ this.getAlloyTouch }
                    refresh={ this.refresh }
                    loadMore={ this.loadMore }
                    hasMore={ this.props.findOthers.pageNo * this.props.findOthers.pageSize < this.props.findOthers.totalRows  }
                    // itemWrapperClass={ goods_list }
                    // bottomStyle={ layoutType == true ? {} : { marginTop:"0.2rem", paddingTop:'0rem' } }
                    renderItem={(v,i,a)=>{
                        return <FindFollowItem dispatch={dispatch}  v={v} key={i}  refresh={ this.refresh }></FindFollowItem>
                    }}
                    data={ trendsConnerEntities }>
                </MyListView>}



            </Flex>

        )


    }
}

export default connect(({ findOthers }) => ({ findOthers}))(FindFollow);
